import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userID:'',
    username:'',
    yanzhengma:'1234',
    userphone:'',
    useremail:'',
    flag2:true,
    marketName:'',
    marketType:'',
    marketAuthor:'',
    marketEmail:'',
    marketPhone:'',
    goods_id:0,
    goods_name:'',
    goods_price:0.0,
    goods_type:'',
    goods_num:0,
    myGoodsData:[],
    orderData:[],
    UserGoodsInfo:[],
    managUser:[],
    managShop:[]
  },
  mutations: {
    setUser(state,username){
      state.username = username;
    },
    setYan(state,yanzhengma){
      state.yanzhengma=yanzhengma;
    },
    setUserPhone(state,userphone){
      state.userphone=userphone;
    },
    setUseremail(state,useremail){
      state.useremail = useremail;
    },
    setFlag(state,flag){
      state.flag2 = flag;
    },
    setMarketName(state,marketName){
      state.marketName = marketName;
    },
    setMarketType(state,marketType){
      state.marketType = marketType;
    },
    setMarketAuthor(state,marketAuthor){
      state.marketAuthor = marketAuthor;
    },
    setMarketEmail(state,marketEmail){
      state.marketEmail = marketEmail;
    },
    setMarketPhone(state,marketPhone){
      state.marketPhone = marketPhone;
    },
    setGoodsID(state,goodsid){
      state.goods_id = goodsid;
    },
    setGoodsName(state,goodsname){
      state.goods_name = goodsname;
    },
    setGoodsPrice(state,goodsprice){
      state.goods_price = goodsprice;
    },
    setGoodsType(state,goodstype){
      state.goods_type = goodstype;
    },
    setGoodsNum(state,goodsnum){
      state.goods_num = goodsnum;
    },
    setMyGoodsData(state,goodsData){
      state.myGoodsData = goodsData;
    },
    setOrderData(state,orderdata){
      state.orderData = orderdata;
    },
    setUserID(state,UserID){
      state.userID = UserID;
    },
    setUserGoodsInfo(state,userGoodsinfo){
      state.UserGoodsInfo = userGoodsinfo;
    },
    setmanagUser(state,mangeUser){
      state.managUser = mangeUser;
    },
    setmanagShop(state,managShop){
      state.managShop = managShop;
    }
  },
  actions: {
    setUsername(context,username){
      context.commit('setUser',username);
    },
    setYan1(context,yanzhengma){
      context.commit('setYan',yanzhengma);
    },
    setuserphone(context,phone){
      context.commit('setUserPhone',phone);
    },
    setuseremail(context,email){
      context.commit('setUseremail',email);
    },
    setFlag2(context,flag){
      context.commit('setFlag',flag);
    },
    setMarketname(context,marketname){
      context.commit('setMarketName',marketname);
    },
    setMarkettype(context,markettype){
      context.commit('setMarketType',markettype);
    },
    setMarketauthor(context,marketauthor){
      context.commit('setMarketAuthor',marketauthor);
    },
    setMarketemail(context,marketemail){
      context.commit('setMarketEmail',marketemail);
    },
    setMarketphone(context,marketphone){
      context.commit('setMarketPhone',marketphone);
    },
    setGoodsid(context,goodsid){
      context.commit('setGoodsID',goodsid);
    },
    setGoodsname(context,goodsname){
      context.commit('setGoodsName',goodsname);
    },
    setGoodsprice(context,goodsprice){
      context.commit('setGoodsPrice',goodsprice);
    },
    setGoodstype(context,goodstype){
      context.commit('setGoodsType',goodstype);
    },
    setGoodsnum(context,goodsnum){
      context.commit('setGoodsNum',goodsnum);
    },
    setMyGoods(context,goodsData){
      context.commit('setMyGoodsData',goodsData);
    },
    setOrderdata(context,orderdata){
      context.commit('setOrderData',orderdata);
    },
    setUserid(context,userid){
      context.commit('setUserID',userid);
    },
    setUserGoodsinfo(context,usergoodsinfo){
      context.commit('setUserGoodsInfo',usergoodsinfo);
    },
    setmanaguser(context,mangeUser){
      context.commit('setmanagUser',mangeUser);
    },
    setmanagshop(context,managShop){
      context.commit('setmanagShop',managShop);
    }
  },
  modules: {
  }
})
